import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class demo2 {
    static int fun2(int n,int[] arr) {
        int sum=0;
        Arrays.sort(arr);
        for(int i=0;i<n;i++) {
            sum+=arr[arr.length-(n+i)];
        }
        return sum;
    }

    public static void main(String[] args) {
        int n;
        Scanner scanner = new Scanner(System.in);
        n=scanner.nextInt();
        int[] arr = new int[n*3];
        for(int i=0;i<n*3;i++) {
            arr[i]=scanner.nextInt();
        }
        System.out.println(fun2(n,arr));

    }
}
